package niuke;

import java.util.Scanner;

public class 编码 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int n = str.length();
        System.out.println(f(str));
    }

    public static long f(String str){
        int n = str.length();
        long result = 0;
        if(n==1){
            return 1;
        }else if (n == 0){
            return 0;
        }
        //先算出 大概的
        for(int i=0;i<n-1;i++){
            int p = n-i-1;
            int k =swap(str.charAt(i))-1;
            if(k<=0){
                continue;
            }
            result = (long) (result + k*Math.pow(25,p));
            p--;
            while (p>0){
                result = (long) (result + Math.pow(25,p));
                p--;
            }
        }

        //再求具体的
        for(int i=0;i<n-1;i++){
            if(swap(str.charAt(i)) != 1){
                continue;
            }
            result = result + f(str.substring(i,n-1));
        }
        return result + swap(str.charAt(n-1));
    }

    public static int swap(int a){
        return a-96;
    }

}
